<template>
	<div class="card-item" @click="pathPush">
		<div class="picture">
			<img v-lazy="data.img" />
			<div class="count">
				<span class="fl">
					<i class="iconfont icon-play2"></i>
					11
				</span>
				<span class="fr">
					<i class="iconfont icon-file-text"></i>
					{{data.commentlen ? data.commentlen : 0}}
				</span>
			</div>
		</div>
		<div class="title">{{data.name}}</div>
	</div>
</template>

<script>
	export default {
		props: {
			data: {
				type: Object,
				default() {
					return {}
				}
			}
		},
		methods: {
			pathPush() {
				// 判断是否是相同路径
				if (this.$route.fullPath == `/detail?id=${this.data.id}`) return
				this.$router.push({name:'Detail', query: {id: this.data.id}})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>